import { forwardRef, Module } from '@nestjs/common';
import { MenuService } from './menu.service';
import { MenuController } from './menu.controller';
import { JwtModule } from '@nestjs/jwt';
import { TypeOrmModule } from '@nestjs/typeorm';
import { jwtConstants, signOptions } from 'src/common/auth/constants';
import { MenuEntity } from './entities/menu.entity';
import { MenuButtonEntity } from './entities/menuButton.entity';
import { OperationRecordModule } from '../operation-record/operation-record.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([MenuEntity, MenuButtonEntity]),
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions,
    }),
    forwardRef(() => OperationRecordModule),
  ],
  controllers: [MenuController],
  providers: [MenuService],
  exports: [MenuService],
})
export class MenuModule { }
